<template>
  <div>
    <el-steps :active=stepNum class="step" finish-status="success">
      <el-step title="步骤 1" description="填写供应商注册信息"></el-step>
      <el-step title="步骤 2" description="系统正在审核当中"></el-step>
      <el-step title="步骤 3" description="审核完成"></el-step>
    </el-steps>
    <el-result v-bind:icon=this.icon v-bind:title=this.info></el-result>
    <el-button v-if="isOK" type="primary" @click="chanageRegistration"  class="searchBox" size="medium">重新注册</el-button>


  </div>
</template>

<script>
import Navigation from "@/components/Navigation";
import HeaderMenu from "@/components/HeaderMenu";

export default {
  name: "examineAndVerify",
  data() {
    return {
      stepNum: '0',
      // success成功,error失败
      icon: "success",
      info: '成功',
      nameStr: '',
      isOK:false
    }
  },
  mounted() {
    this.nameStr = this.$store.state.username
    this.init();
  },
  methods: {
    init() {
      this.$axios.get("api/getExamineResult/" + this.nameStr).then(
          // 供应商资质审核状态;0-审核中,1-审核通过,2-未审核通过,3-异常
          r => {
            console.log(r.data)
            if (r.data == 0) {
              this.stepNum = 1;
              this.icon = 'info';
              this.info = '审核中';
            }
            if (r.data == 1) {
              this.stepNum = 2;
              this.icon = 'info';
              this.info = '审核通过';

            }
            if (r.data == 2) {
              this.isOK = true
              this.stepNum = 2;
              this.icon = 'success';
              this.info = '未审核通过';

            }
            if (r.data == 3) {
              this.isOK = true
              this.stepNum = 2;
              this.icon = 'error';
              this.info = '异常';
            }
          }
      )
    },
    chanageRegistration(){
      this.$router.push("registerSupplier")
    },
  }
}
</script>

<style scoped>
.step {
  margin: 50px auto;
}
</style>